class Chronograph {
    constructor() {
        this.t = []
        this.prev = new Date()
        this.n = []
    }
    p(n) {
        let now = new Date()
        this.t.push(now - this.prev)
        this.prev = now
        this.n.push(n)
    }
    fmt() {
        let r = []
        for (let i = 0; i < this.n.length; i++) {
            r.push([this.n[i], this.t[i]])
        }
        return r
    }
}

module.exports = () => new Chronograph()